package com.zyong.design.pattern.responsibility.case4;

/**
 * @program: zyong-design-pattern
 * @ClassName: PmHandler
 * @author: zyong
 * @create: 2024-04-13 18:16
 */
public class PmHandler extends AbstractApproveHandler {
    @Override
    protected void process(LeaveRequest request) {
        if (request.getName() != null) {
            if (request.getNumOfDays() <= 3) {
                System.out.println(request.getName() + ", 你通过项目经理的审批");
            } else {
                System.out.println("项目经理转交总经理");
                if (nextHandler != null) {
                    nextHandler.process(request);
                }
            }
        } else {
            System.out.println("请假单未填写完整，未通过项目经理审批");
        }
    }
}
